package cn.zjweu.service.impl;

import cn.zjweu.service.BorrowService;
import cn.zjweu.mapper.BorrowBookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;
import java.util.Map;

@Service
public class BorrowServiceImpl implements BorrowService {

    @Autowired
    private BorrowBookMapper borrowBookMapper;


    @Override
    public int BorrowBook(int userId, int bookId, Date date) {
        return borrowBookMapper.borrowBook(userId, bookId, date);
    }

    @Override
    public List<Map<String, Object>> getAllBorrowList() {
        return borrowBookMapper.getAllBorrowList();
    }

    @Override
    public List<Map<String, Object>> getAllBorrowListById(int id) {
        return borrowBookMapper.getAllBorrowListById(id);
    }

    @Override
    public int deleteById(int id) {
        return borrowBookMapper.deleteById(id);
    }
}
